<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : Rational ClearCase Source Control Block</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : Rational ClearCase Source Control Block
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Sep 11, 2008 by <font color="#0050B2">williams</font>.
				    </div>

				    <h3><a name="RationalClearCaseSourceControlBlock-RationalClearCaseConfiguration"></a>Rational ClearCase Configuration</h3>


<h4><a name="RationalClearCaseSourceControlBlock-Typical%2FMinimalConfiguration"></a>Typical / Minimal Configuration</h4>

<p>For most uses the following is all you'll need in your <a href="Configuring the Server.html" title="Configuring the Server"><tt>ccnet.config</tt></a>:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"clearCase"</span>&gt;</span>
    <span class="code-tag">&lt;viewPath&gt;</span>C:\PATH\TO\SOURCE<span class="code-tag">&lt;/viewPath&gt;</span>
    <span class="code-tag">&lt;autoGetSource&gt;</span>true<span class="code-tag">&lt;/autoGetSource&gt;</span>
<span class="code-tag">&lt;/sourcecontrol&gt;</span></pre>
</div></div>
<p>This will:</p>
<ul>
	<li>monitor ClearCase for any changes on the viewPath or below</li>
	<li>retrieve the lastest source from ClearCase when any changes are detected</li>
	<li>apply a label to the built files at the end of the build</li>
</ul>


<p><a name="RationalClearCaseSourceControlBlock-viewPath"></a><br/>
The <tt>&lt;viewPath&gt;</tt> specifies a directory on your filesystem that CCNet monitors for changes.  The path must be a versioned object.  CCNet checks the actual VOB for changes, not the local filesystem.</p>

<p><tt>&lt;viewPath&gt;</tt> doesn't have to be the root of the local ClearCase view.  It may be any of the root's children or even a single object.</p>

<h4><a name="RationalClearCaseSourceControlBlock-FullConfiguration"></a>Full Configuration</h4>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"clearCase"</span>&gt;</span>
    <span class="code-tag">&lt;viewPath&gt;</span>C:\PATH\TO\SOURCE<span class="code-tag">&lt;/viewPath&gt;</span>
    <span class="code-tag">&lt;branch&gt;</span>main<span class="code-tag">&lt;/branch&gt;</span>
    <span class="code-tag">&lt;autoGetSource&gt;</span>false<span class="code-tag">&lt;/autoGetSource&gt;</span>
    <span class="code-tag">&lt;useLabel&gt;</span>true<span class="code-tag">&lt;/useLabel&gt;</span>
    <span class="code-tag">&lt;useBaseline&gt;</span>false<span class="code-tag">&lt;/useBaseline&gt;</span>
    <span class="code-tag">&lt;projectVobName&gt;</span>PROJECT_VOB_NAME<span class="code-tag">&lt;/projectVobName&gt;</span>
    <span class="code-tag">&lt;viewName&gt;</span>PROJECT_VIEW_NAME<span class="code-tag">&lt;/viewName&gt;</span>
    <span class="code-tag">&lt;executable&gt;</span>cleartool.exe<span class="code-tag">&lt;/executable&gt;</span>
    <span class="code-tag">&lt;timeout&gt;</span>50000<span class="code-tag">&lt;/timeout&gt;</span>
<span class="code-tag">&lt;/sourcecontrol&gt;</span></pre>
</div></div>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Element </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
<th class='confluenceTh'> Default </th>
</tr>
<tr>
<td class='confluenceTd'> viewPath </td>
<td class='confluenceTd'> The path that CCNet will check for modifications and use to apply the label. See <a href="#RationalClearCaseSourceControlBlock-viewPath">above</a> for full details. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> none </td>
</tr>
<tr>
<td class='confluenceTd'> branch </td>
<td class='confluenceTd'> The name of the branch that CCNet will monitor for modifications.  Note that the config spec of the view being built from must also be set up to reference this branch. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> none </td>
</tr>
<tr>
<td class='confluenceTd'> autoGetSource </td>
<td class='confluenceTd'> Specifies whether the current version of the source should be retrieved from ClearCase </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> useLabel </td>
<td class='confluenceTd'> Specifies whether a label should be applied when the build is successful. </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> useBaseline </td>
<td class='confluenceTd'> Specifies whether a baseline should be applied when the build is successful.  Requires the VOB your view references to be a UCM VOB.  Requires that you specify <tt>&lt;viewName&gt;</tt> and <tt>&lt;projectVobName&gt;</tt>. </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> executable </td>
<td class='confluenceTd'> Specifies the path to the ClearCase command line tool.  You should only have to include this element if the tool isn't in your path.  By default, the ClearCase client installation puts cleartool in your path. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> cleartool.exe </td>
</tr>
<tr>
<td class='confluenceTd'> projectVobName </td>
<td class='confluenceTd'> The name of the project VOB that the view path uses. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> if <tt>&lt;useBaseline&gt;</tt> is <tt>true</tt> </td>
<td class='confluenceTd'> none </td>
</tr>
<tr>
<td class='confluenceTd'> viewName </td>
<td class='confluenceTd'> The name of the view that you're using. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> if <tt>&lt;useBaseline&gt;</tt> is <tt>true</tt> </td>
<td class='confluenceTd'> none </td>
</tr>
<tr>
<td class='confluenceTd'> timeout </td>
<td class='confluenceTd'> Sets the timeout period for the source control operation. See <a href="Timeout Configuration.html" title="Timeout Configuration">Timeout Configuration</a> for details. </td>
<td class='confluenceTd'> Timeout </td>
<td class='confluenceTd'> 10 minutes </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> issueUrlBuilder </td>
<td class='confluenceTd'> Converts the comment (or parts from it) into an url pointing to the issue for this build. <br clear="all" />
See <a href="IssueUrlBuilder.html" title="IssueUrlBuilder">Issue Builder</a> for more details <br clear="all" /> </td>
<td class='confluenceTd'> Group </td>
<td class='confluenceTd'> N/A </td>
<td class='confluenceTd'> false <br clear="all" /> </td>
</tr>
</tbody></table>

<h4><a name="RationalClearCaseSourceControlBlock-CommonProblems"></a>Common Problems</h4>


<h5><a name="RationalClearCaseSourceControlBlock-Thebuildisinitiatedwhenuserscheckinonprivatebranches"></a>The build is initiated when users check in on private branches</h5>

<p>By default, ClearCase returns a history for every file in every branch, even if the config spec limits to a single branch.  You must specify <tt>&lt;branch&gt;</tt> in order to limit which changes CCNet can see.</p>

<h5><a name="RationalClearCaseSourceControlBlock-AfterthebuildissuccessfulIgeta%22Baselinenotfound%22errormessage."></a>After the build is successful I get a "Baseline not found" error message.</h5>

<p>An example of this message is:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed:
cleartool: Error: Baseline not found: "CruiseControl.NETTemporaryBaseline_05-06-2004-16-34-15".
</pre>
</div></div>
<p>This happens when <tt>&lt;projectVobName&gt;</tt> is not set to the project VOB.  Typically this happens when the user specifies the UCM VOB instead of the project VOB.</p>

<p>To correct the problem, change the value in that element to the name of the project VOB.</p>

<h4><a name="RationalClearCaseSourceControlBlock-KnownBugs"></a>Known Bugs</h4>


<h5><a name="RationalClearCaseSourceControlBlock-WhenIviewmybaselines%2CIseethatthey%27recalled%7B%7BCruiseControl.NET%5Csomething%5C%7D%7Dinsteadof%7B%7Bv1.0.0.4%7D%7D."></a>When I view my baselines, I see that they're called <tt>CruiseControl.NET[something]</tt> instead of <tt>v1.0.0.4</tt>.</h5>

<p>This is a bug in ClearCase; Rational is aware of it.  It only occurs if you're using baselines.</p>

<p>CCNet creates a temporary baseline with the prefix <tt>CruiseControl.NET</tt> before renaming it to the final value, such as <tt>v1.5.2.3</tt>.  Depending on how you view baselines in ClearCase, you may see the temporary or real name.</p>

<p>For example, if you use the admin console, you'll see the old, temporary value.  If use use <tt>cleartool lsbl</tt>, you'll see the correct one:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>M:\gsmith_GS_Project_int\GS_UCM_VOB&gt;cleartool lsbl
06-May-04.16:28:27  v1.0.0.1  gsmith   "CruiseControlTemporaryBaseline_05-06-200
4-16-28-26"
  stream: GS_Project_Integration@\GS_PVOB
  component: GS_UCM_VOB@\GS_PVOB
06-May-04.16:34:16  v1.0.0.2  gsmith   "CruiseControl.NETTemporaryBaseline_05-06
-2004-16-34-15"
  stream: GS_Project_Integration@\GS_PVOB
  component: GS_UCM_VOB@\GS_PVOB
</pre>
</div></div>

<h5><a name="RationalClearCaseSourceControlBlock-CruiseControl.NETseescheckinsonallbranches%2Cnotjusttheonespecifiedinmyconfigspec"></a>CruiseControl.NET sees checkins on all branches, not just the one specified in my config spec</h5>

<p>This is due to the fact that the ClearCase history command (lshist) returns a complete history for the file, not just the history that can be seen by the config spec.</p>

<p>The workaround is to make sure you include a <tt>&lt;branch&gt;</tt> element in your configuration.  This will force ccnet to just see changes on that branch.</p>

<h5><a name="RationalClearCaseSourceControlBlock-CruiseControl.NETdoesn%27tseemychanges"></a>CruiseControl.NET doesn't see my changes</h5>

<p>Make sure the clock of your build server is synchronised to the clock of your ClearCase server.  See <a href="http://jira.public.thoughtworks.org/browse/CCNET-271">CCNET-271</a>.</p>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>